package com.zzgele.qmzb.api.dao;

import com.zzgele.qmzb.api.core.Mapper;
import com.zzgele.qmzb.api.model.VideoLike;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public interface VideoLikeMapper extends Mapper<VideoLike> {

     @Insert("insert video_like (uid,vid,create_time) values (#{uid},#{vid},#{create_time})")
     int like(Map<String, Object> map);

     @Delete("delete from video_like where uid=#{uid} and vid=#{vid}")
     int dislike(Map<String, Object> map);

     @Select("select count(*) from video_like where uid=#{uid} and vid=#{vid} ")
     int isExist(Map<String, Object> map);

}